import request from '@/utils/request'
import type { LoginParams, LoginResponse, userResponseData } from './types'

enum Api {
  LOGIN_URL = 'user/login',
  USERINFO_URL = '/user/info',
}

/**
 * @description: user login api
 */
export const loginApi = (data: LoginParams) =>
  request.post<any, LoginResponse>(Api.LOGIN_URL, data)

export const userInfo = () =>
  request.get<any, userResponseData>(Api.USERINFO_URL)
